<template>
    <div style="height:80%" id="zhexian">
        
    </div>
</template>
<script setup>
import * as echarts from 'echarts';
 import {
        onMounted,
        ref,
        reactive
    } from 'vue'
    onMounted(()=>{
var chartDom = document.getElementById('zhexian');
var myChart = echarts.init(chartDom);
var option;

option = {
  title: {
    text: '用户捐赠图节点类型占比',
    textStyle:{
      fontSize:22
    },
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: '用户捐赠图节点类型占比',
      type: 'pie',
      radius: '50%',
      data:  [
        { value: 33807, name: '主播' },
        { value: 2143, name: '有过捐赠行为的主播' },
        { value: 75450, name: '普通用户' },
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};
option && myChart.setOption(option);
    })
</script>
